<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty {site_buy_buttons} function plugin
 *
 * Type:     function<br>
 * Name:     site_buy_buttons <br>
 *           the passed parameters
 *      (Smarty online manual)
 * @author Bhatu Pawar <bhatupawar85 at gmail dot com>
 * @param array
 * @param Smarty
 * @return string
 */

function smarty_function_site_buy_buttons($params, &$smarty)
{
	require_once DOC_ROOT."/model/website.php";

	$webObj = new Model_Website();	

	$web_button_attribute = $webObj->getWebsiteAttribute_value($_SESSION[MY_SITE]['current_site_id'], $params["btn_attr_id"]);

	// Button color
	$web_button_color_attributeArray = $webObj->getWebsiteAttribute_value($_SESSION[MY_SITE]['current_site_id'], 5);
	//print_r($web_button_color_attributeArray);
	$web_button_color_attribute = $web_button_color_attributeArray["attribute_value"] ;

	//$SubmitButtonCSS  = "background:#f4720c url(../images/white_gradient.png) repeat-x top; border:1px solid $web_button_color_attribute; font-size:25px; color:#fff; padding:5px 15px; cursor:pointer; text-shadow:1px 1px #777777; font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; margin-top:25px;background-color:$web_button_color_attribute;";
	
	// $SubmitButtonCSS  = "background:url(../images/white_gradient.png) repeat-x top $web_button_color_attribute; border:1px solid $web_button_color_attribute;";

	$SubmitButtonCSS  = "background-color:$web_button_color_attribute; border:1px solid $web_button_color_attribute;";
	
	$site_buttons = '<div style="'.$SubmitButtonCSS.'" class="BuyNow_button">'.$web_button_attribute["attribute_value"].'</div>';

	return $site_buttons;
}

/* vim: set expandtab: */

?>
